<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>错误日志基本信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/systemStatic/style/admin.css">
    <link rel="stylesheet" href="${ctx}/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/css/public.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
    <style>
        .layui-form-label {
            padding: 9px 0px;
            text-align: left;
        }
    </style>
</head>
<body>

<script type="text/html" template>
<form class="layui-form" style="padding: 0px 30px;width: 590px;margin-left: auto;margin-right: auto" lay-filter="sysErrorLogDataForm">

    <div style="margin: 15px 0px;height: 550px;overflow: auto;">
        <div class="layui-form-item" >
            <label class="layui-form-label">错误码</label>
            <div class="layui-input-block">
                <input type="text" name="id"
                       autocomplete="off" class="layui-input " maxlength="50" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">错误code</label>
            <div class="layui-input-block">
                <input type="text" name="hashcode"
                       autocomplete="off" class="layui-input " maxlength="50" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">用户</label>
            <div class="layui-input-block">
                <input type="text" name="account"
                       autocomplete="off" class="layui-input " maxlength="50" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">IP地址</label>
            <div class="layui-input-block">
                <input type="text" name="ip"
                       autocomplete="off" class="layui-input " maxlength="50" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">错误URL</label>
            <div class="layui-input-block">
                <input type="text" name="errorurl"
                       autocomplete="off" class="layui-input " maxlength="50" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">错误日期</label>
            <div class="layui-input-block">
                <input type="text" name="errordate"
                       autocomplete="off" class="layui-input dateTimeFiled time-init" maxlength="50" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">错误信息</label>
            <div class="layui-input-block">
                <textarea type="text" name="error" style="min-height: 210px;max-width: 100%"
                       autocomplete="off" class="layui-input " disabled></textarea>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block" style="width: 100%; text-align: center;margin: 0;">
            <button type="reset" id="closeWindow" style="margin-left: 10px;" class="layui-btn btn-n layui-btn-danger btn-save">关闭</button>
        </div>
    </div>
</form>
</script>
<script src="${ctx}/public/component.js" type="text/javascript"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>

    layui.config({
        base: serverPath.systemPath + staticPath.systemPath //静态资源所在路径
    }).extend({
        index: 'index' //主入口模块
    }).use(['index','common','laydate','jquery','commons','setter','form'], function () {
        var laydate = layui.laydate;
        var $ = layui.jquery;
        var commons = layui.commons;
        var setter = layui.setter;
        var form = layui.form;
        var id = "${id}";
        $.ajax({
            url: serverPath.systemPath + setter.sysLinkPath + "sysErrorLog/get",
            type: "get",
            contentType: 'application/json',
            dataType: 'json',
            data: {id: id},
            success: function (data) {
                if (commons._filterRecord(data)) {
                    var returnDate = data.data;
                    form.val('sysErrorLogDataForm', {
                        "id": returnDate.id,
                        "hashcode": returnDate.hashcode,
                        "account": returnDate.account,
                        "ip": returnDate.ip,
                        "errorurl": returnDate.errorurl,
                        "errordate": component.timeData(returnDate.errordate,"1"),
                        "error": returnDate.error
                    });
                } else {
                    window.parent.layer.alert(data.msg);
                }
            }
        });

        //关闭当前页面
        $("#closeWindow").click(function () {
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        });
    });
</script>
</body>
</html>